#!/bin/bash
#========================================================================
# Author: YSLin
# Email: 
# File Name: all.sh
# Description: 
#	1.Dalvik runtime libraries
#                    Dalvik  JVM
#   java.io          Y       Y
#   java.net         Y       Y
#   android.*        Y       N
#   com.google.*     Y       N
#   javax.swing.*    N       Y
#   ...              ...     ...

#  2.Compile and Reverse Engineer
#     ┌──JAD/JD-GUI/dava──┐       ┌────undx/dex2jar───┐ ┌──────smali─────*.smali
#   *.java              *.class/*.jar               *.dex
#     └───────javac───────┘  │    └────────dx─────────┘ └─────dexdexer───*.ddx      
#                            │
#  3.Static checking tools (findbugs)
#
# Edit History: 
#   2010-12-29    File created.
#========================================================================

#JAD: http://en.wikipedia.org/wiki/JAD_(JAva_Decompiler)
#JD-GUI: http://java.decompiler.free.fr/
#xjad
#dava: http://www.sable.mcgill.ca/dava/

#apktool -> smali

#========================================================================
# Name: undx
# Author: Marc Schönefeld
# Source: https://github.com/quine/ig-undx  (git clone git://github.com/quine/ig-undx.git)
# Building undx:
#   You can build undx with Apache Maven using
#   $ mvn install
#   You can then run undx with
#   $ java -jar target/undx-snapshot-jar-with-dependencies.jar [options]
# Blog: http://www.illegalaccess.org/index.html
# Feed undx an Android APK file and it will try to convert it to a JAR file (which you can then feed to JD-GUI or JAD).
# As Marc points out, undx is a first step at converting Dalvik to Java. It’s far from perfect or complete. 
# Looking at the decompiled code will show you a number of functions which, well, don’t really function. 
# Variables may have the wrong type, case statements may just fall through, and loops sometimes never break out. 
# We’ve found that Dex2Jar does a much better job converting Dalvik to Java. 
#========================================================================


#========================================================================
# Name: dexdexer 
# Author: Gabor Paller
# Blog: http://pallergabor.uw.hu
# Source: http://dedexer.sourceforge.net/
#========================================================================


#========================================================================
# Name: smali/baksmali
# Author: jesusfreke
# Blog: http://jf.andblogs.net/
# Source: http://code.google.com/p/smali/
# Description:
#	More and more, we’ve been finding that smali/baksmali gives us what we need: 
#	Dalvik in a readable format that we can alter, recompile, then test on a device. 
#	Its true that smali/baksmali has a different goal than undx and dex2jar 
#   (smali/baksmali is an assembler/disassembler), 
#	but it gives us what we need to do most of the time in a quick and 
#   easy way (especially when packaged with APKTool).
#	We’ve written a few scripts that can work with the smali output and help 
#   us zero in on the code we’re interested in for an assessment, 
#	and then its ability to support changes to the application and quickly 
#   recompile is priceless. 
#	This is likely a tool we’ll be working with considerably going forward with Android.
#========================================================================


#========================================================================
# Name: dex2jar 
# Author: Panxiaobo <pxb1988>
# Blog: 
# Source: http://code.google.com/p/smali/
# Description:
# 	Dex2Jar does a very impressive job. However, against larger or 
#	more complex applications, it can fail.
#   下载dex2jar最新版http://code.google.com/p/dex2jar/downloads/list
#   解压dex2jar-version.zip文件到一个目录. 比方说 _/home/panxiaobo/_
#   {{{unzip -x dex2jar-version.zip -d /home/panxiaobo}}}
#   使用 dex2jar 来生成 .jar 文件
#   {{{/home/panxiaobo/dex2jar-version/dex2jar.sh /home/panxiaobo/someApk.apk}}}
#   dex2jar会在someApk.apk所在目录下生成一个someApk.apk.dex2jar.jar文件
#   使用反编译工具获取查看源代码
#     * [http://java.decompiler.free.fr/?q=jdgui jd-gui]
#     * [http://www.varaneckas.com/jad JAD]
#========================================================================


#dxcut

#dex2dot (control flow!!)
#http://blog.nelhage.com/2010/12/some-android-reverse-engineering-tools/
#https://github.com/nelhage/reverse-android
# git clone git://github.com/nelhage/reverse-android.git

#androidguard
#http://code.google.com/p/androguard/

#dalvik opcodes
#mydroid_froyo32bit/dalvik/docs/instruction-formats.html
#mydroid_froyo32bit/dalvik/docs/dalvik-bytecode.html
#mydroid_froyo32bit/dalvik/docs/instruction-formats.html
#mydroid_froyo32bit/dalvik/docs/dex-format.html
#http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html
